package com.salelogistics.basic.service.impl;

import java.util.List;

import com.salelogistics.basic.domain.BasRoutes;
import com.salelogistics.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.salelogistics.basic.mapper.BasStationMapper;
import com.salelogistics.basic.domain.BasStation;
import com.salelogistics.basic.service.IBasStationService;

/**
 * 站点Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-07-09
 */
@Service
public class BasStationServiceImpl implements IBasStationService 
{
    @Autowired
    private BasStationMapper basStationMapper;

    /**
     * 查询站点
     * 
     * @param routeId 站点主键
     * @return 站点
     */
    @Override
    public List<BasStation> selectBasStationByStationId(Long routeId)
    {
        return basStationMapper.selectBasStationByStationId(routeId);
    }

    /**
     * 查询站点列表
     * 
     * @param basStation 站点
     * @return 站点
     */
    @Override
    public List<BasStation> selectBasStationList(BasStation basStation)
    {
        return basStationMapper.selectBasStationList(basStation);
    }

    /**
     * 新增站点
     * 
     * @param basStation 站点
     * @return 结果
     */
    @Override
    public int insertBasStation(BasStation basStation)
    {
        basStation.setCreateTime(DateUtils.getNowDate());
        return basStationMapper.insertBasStation(basStation);
    }

    /**
     * 修改站点
     * 
     * @param basStation 站点
     * @return 结果
     */
    @Override
    public int updateBasStation(BasStation basStation)
    {
        return basStationMapper.updateBasStation(basStation);
    }

    /**
     * 批量删除站点
     * 
     * @param stationIds 需要删除的站点主键
     * @return 结果
     */
    @Override
    public int deleteBasStationByStationIds(Long[] stationIds)
    {
        return basStationMapper.deleteBasStationByStationIds(stationIds);
    }

    /**
     * 删除站点信息
     * 
     * @param stationId 站点主键
     * @return 结果
     */
    @Override
    public int deleteBasStationByStationId(Long stationId)
    {
        return basStationMapper.deleteBasStationByStationId(stationId);
    }

    /**
     * 更新线路修改时间
     *
     * @param basRoutes 线路
     * @return 结果
     */
    public int updateBasRoutesEditedTime(BasRoutes basRoutes) {
        return basStationMapper.updateBasRoutesEditedTime(basRoutes);
    }

}
